import java.util.concurrent.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 22652
 * Date: 2024-04-20
 * Time: 22:10
 */
public class test_4 {
    public static void main(String[] args) {
        ExecutorService pool=new ThreadPoolExecutor(5,10,3,
                TimeUnit.SECONDS, new LinkedBlockingQueue<>(100),Executors.defaultThreadFactory(),
                new ThreadPoolExecutor.DiscardPolicy());
        for (int i = 0; i < 2000; i++) {
            pool.submit(()-> System.out.println(Thread.currentThread().getName() + "已执行.")
            );
        }
    }
}
